#pragma once
#include <iostream>
#include "modbus.h"
#include "cmodule.hpp"
#include "cmodule_mgr.hpp"
#include "ctimer.hpp"
class device
{
public:
    virtual int init();
    public:
    int m_slaveid;
    modbus_t *ctx = NULL; 
};

class p300device:public device
{

public:

    int read_press();
    int read_param_value();
    int write_param_value();
};


class devicemgr_module :public CModule
{
public:
    void init();
    virtual void      start();
    virtual void    handle_msg(CMsg_Ptr pMsg);

    void handle_update();
    static shared_ptr<devicemgr_module> getInstance();
    static shared_ptr<devicemgr_module>     pdevicemgr;
    Ttimer<mstm,1>  m_loopWkTm;
    p300device m_device1;
    device* m_sensordevice;

};